package model

import "time"

type Memberships struct {
	Id        uint64    `gorm:"column:id;type:bigint UNSIGNED;comment:ID;primaryKey;not null;" json:"id"`             // ID
	UserId    int       `gorm:"type:int;index;not null;comment:'用户Id'"`                                               // 用户id
	Level     uint64    `gorm:"column:level;type:bigint UNSIGNED;comment:等级: 1-vip;not null;default:0;" json:"level"` // 等级: 1-vip1, 2-vip2,3-vip3
	StartDate int       `gorm:"type:int;default:0;not null;comment:'开始时间'"`                                           // 开始时间
	EndDate   int       `gorm:"type:int;default:0;not null;comment:'结束时间'"`                                           // 结束时间
	Created   time.Time `gorm:"column:created;type:datetime(3);not null;" json:"created"`
}
type MemberRecord struct {
	UserId   int       `gorm:"type:int;index;not null;comment:'用户Id'"`
	MemberId int       `gorm:"type:int;index;not null;comment:'会员Id'"`
	Created  time.Time `gorm:"column:created;type:datetime(3);not null;" json:"created"`
}

func (m *Memberships) TableName() string {
	return "memberships"
}
func (mr *MemberRecord) TableName() string {
	return "member_record"
}
